package Class.Advance.Lambda;

public class Test {
    private static void innerClass(Swim swim){
        swim.swim();
    }

    public static void main(String[] args) {
        // 匿名内部类
        innerClass(new Swim() {
            @Override
            public void swim() {
                System.out.println("Swimming~");
            }
        });
        // lambda表达式(仅仅可以简化函数式接口(仅有一个抽象方法的接口))
        innerClass(()->{
            System.out.println("Swimming~");
        });
    }
}
